/// code : 200
/// msg : "获取成功"
/// data : {"list":[{"id":8,"name":"其他问题","status":1,"sort":0,"update_time":"2021-12-24 15:23:08","create_time":"2021-12-24 15:23:08","son":[{"id":102,"title":"登录","cate_id":8},{"id":102,"title":"登录","cate_id":8}]},{"id":8,"name":"其他问题","status":1,"sort":0,"update_time":"2021-12-24 15:23:08","create_time":"2021-12-24 15:23:08","son":[{"id":102,"title":"登录","cate_id":8}]}]}

class HelpModel {
  HelpModel({
    int? code,
    String? msg,
    HelpData? data,
  }) {
    _code = code;
    _msg = msg;
    _data = data;
  }

  HelpModel.fromJson(dynamic json) {
    _code = json['code'] ?? -1;
    _msg = json['msg'] ?? "";
    _data = json['data'] != null ? HelpData.fromJson(json['data']) : null;
  }

  int? _code;
  String? _msg;
  HelpData? _data;

  int? get code => _code;

  String? get msg => _msg;

  HelpData? get data => _data;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['code'] = _code;
    map['msg'] = _msg;
    if (_data != null) {
      map['data'] = _data?.toJson();
    }
    return map;
  }
}

/// list : [{"id":8,"name":"其他问题","status":1,"sort":0,"update_time":"2021-12-24 15:23:08","create_time":"2021-12-24 15:23:08","son":[{"id":102,"title":"登录","cate_id":8},{"id":102,"title":"登录","cate_id":8}]},{"id":8,"name":"其他问题","status":1,"sort":0,"update_time":"2021-12-24 15:23:08","create_time":"2021-12-24 15:23:08","son":[{"id":102,"title":"登录","cate_id":8}]}]

class HelpData {
  Data({
    List<ProblemList>? list,
  }) {
    _list = list;
  }

  HelpData.fromJson(dynamic json) {
    if (json['list'] != null) {
      _list = [];
      json['list'].forEach((v) {
        _list?.add(ProblemList.fromJson(v));
      });
    } else {
      _list = [];
    }
  }

  List<ProblemList>? _list;

  List<ProblemList>? get list => _list;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_list != null) {
      map['list'] = _list?.map((v) => v.toJson()).toList();
    }
    return map;
  }
}

/// id : 8
/// name : "其他问题"
/// status : 1
/// sort : 0
/// update_time : "2021-12-24 15:23:08"
/// create_time : "2021-12-24 15:23:08"
/// son : [{"id":102,"title":"登录","cate_id":8},{"id":102,"title":"登录","cate_id":8}]

class ProblemList {
  ProblemList({
    int? id,
    String? name,
    String? img_url,
    int? status,
    int? sort,
    String? updateTime,
    String? createTime,
    List<Son>? son,
  }) {
    _id = id;
    _name = name;
    _img_url = img_url;
    _status = status;
    _sort = sort;
    _updateTime = updateTime;
    _createTime = createTime;
    _son = son;
  }

  ProblemList.fromJson(dynamic json) {
    _id = json['id'] ?? -1;
    _name = json['name'] ?? "";
    _img_url = json['img_url'] ?? "";
    _status = json['status'] ?? -1;
    _sort = json['sort'] ?? -1;
    _updateTime = json['update_time'] ?? "";
    _createTime = json['create_time'] ?? "";
    if (json['son'] != null) {
      _son = [];
      json['son'].forEach((v) {
        _son?.add(Son.fromJson(v));
      });
    } else {
      _son = [];
    }
  }

  int? _id;
  String? _name;
  String? _img_url;
  int? _status;
  int? _sort;
  String? _updateTime;
  String? _createTime;
  List<Son>? _son;

  int? get id => _id;

  String? get name => _name;

  String? get img_url => _img_url;

  int? get status => _status;

  int? get sort => _sort;

  String? get updateTime => _updateTime;

  String? get createTime => _createTime;

  List<Son>? get son => _son;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['name'] = _name;
    map['img_url'] = _img_url;
    map['status'] = _status;
    map['sort'] = _sort;
    map['update_time'] = _updateTime;
    map['create_time'] = _createTime;
    if (_son != null) {
      map['son'] = _son?.map((v) => v.toJson()).toList();
    }
    return map;
  }
}

/// id : 102
/// title : "登录"
/// cate_id : 8

class Son {
  Son({
    int? id,
    String? title,
    int? cateId,
  }) {
    _id = id;
    _title = title;
    _cateId = cateId;
  }

  Son.fromJson(dynamic json) {
    _id = json['id'];
    _title = json['title'];
    _cateId = json['cate_id'];
  }

  int? _id;
  String? _title;
  int? _cateId;

  int? get id => _id;

  String? get title => _title;

  int? get cateId => _cateId;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['title'] = _title;
    map['cate_id'] = _cateId;
    return map;
  }
}
